package com.zy.activity

import android.os.Bundle
import android.view.WindowManager
import androidx.fragment.app.Fragment

abstract class BaseMainActivity : BaseActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        window.setFlags(
            WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN
        )

        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_base_main)
        val fragment = containerFragment
        if (fragment != null) {
            supportFragmentManager.beginTransaction().add(R.id.base_main_container, fragment)
                .commitNowAllowingStateLoss()
        }
    }

    protected abstract val containerFragment: Fragment?
}